package com.yx.study.leet.primary.other;

/**
 * 汉明距离 异或结果1的个数
 * https://leetcode.cn/leetbook/read/top-interview-questions-easy/xnyode/
 * */
public class HammingDistance {
    public int hammingDistance(int x, int y) {
        return Integer.bitCount(x ^ y);
    }
}
